package com.wctj.api.web.controller.admin;

import com.wctj.api.base.Result;
import com.wctj.api.base.annotation.CheckSign;
import com.wctj.api.base.annotation.SysLog;
import com.wctj.api.business.common.dto.*;
import com.wctj.api.web.handle.PayManagerService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@Slf4j
@RestController
@RequestMapping(value = "financial")
@Api(tags = "财务人员管理接口")
public class AdminController {

    @Resource
    private PayManagerService payManagerService;

    /**
     * 获取 账号详细信息
     * @param accountDTO
     * @return
     */
    @SysLog("查询账号详细信息")
    @PostMapping(value = "getAccountDetail")
    @CheckSign
    public Result<Object> getAccountDetail(@RequestBody @Valid AccountDTO accountDTO) {
        return payManagerService.getAccountDetail(accountDTO);
    }


    /**
     * 分页查询交易信息列表
     * @param transactionDTO
     * @return
     */
    @SysLog("查询交易信息列表")
    @PostMapping(value = "getTransactionList")
    @CheckSign
    public Result<Object> getTransactionList(@RequestBody @Valid TransactionDTO transactionDTO) {
        return payManagerService.getTransactionList(transactionDTO);
    }


    /**
     * 电子回单异步查询
     * @param electronReceiptDTO
     * @return
     */
    @SysLog("电子回单异步查询")
    @PostMapping(value = "getElectronReceipt")
    @CheckSign
    public Result<Object> getElectronReceipt(@RequestBody @Valid ElectronReceiptDTO electronReceiptDTO) {
        return payManagerService.getElectronReceipt(electronReceiptDTO);
    }


    /**
     * 异步打印结果查询
     * @param electronReceiptResultDTO
     * @return
     */
    @SysLog("异步打印结果查询")
    @PostMapping(value = "getElectronReceiptResult")
    @CheckSign
    public Result<Object> getElectronReceiptResult(@RequestBody @Valid ElectronReceiptResultDTO electronReceiptResultDTO) {
        return payManagerService.getElectronReceiptResult(electronReceiptResultDTO);
    }


    /**
     * 代发批次查询
     * @param releasePayBatchDTO
     * @return
     */
    @SysLog("代发批次查询")
    @PostMapping(value = "getReleasePayBatch")
    @CheckSign
    public Result<Object> getReleasePayBatch(@RequestBody @Valid ReleasePayBatchDTO releasePayBatchDTO) {
        return payManagerService.getReleasePayBatch(releasePayBatchDTO);
    }

    /**
     * 代发明细查询
     * @param releasePayDetailDTO
     * @return
     */
    @SysLog("代发明细查询")
    @PostMapping(value = "getReleasePayDetail")
    @CheckSign
    public Result<Object> getReleasePayDetail(@RequestBody @Valid ReleasePayDetailDTO releasePayDetailDTO) {
        return payManagerService.getReleasePayDetail(releasePayDetailDTO);
    }

    /**
     * 代发明细对账单查询请求
     * 该请求需要开通N66010:代发业务明细对账单业务功能 .....
     * @param releasePayReconciliationDTO
     * @return
     */
    @SysLog("代发明细对账单查询请求")
    @PostMapping(value = "getReleasePayReconciliation")
    @CheckSign
    public Result<Object> getReleasePayReconciliation(@RequestBody @Valid ReleasePayReconciliationDTO releasePayReconciliationDTO) {
        return payManagerService.getReleasePayReconciliation(releasePayReconciliationDTO);
    }

    /**
     * 代发明细对账单处理结果查询请求
     * 该请求需要开通N66010:代发业务明细对账单业务功能 .....
     * @param releasePayReconciliationResultDTO
     * @return
     */
    @SysLog("代发明细对账单处理结果查询请求")
    @PostMapping(value = "getReleasePayReconciliationResult")
    @CheckSign
    public Result<Object> getReleasePayReconciliationResult(@RequestBody @Valid ReleasePayReconciliationResultDTO releasePayReconciliationResultDTO) {
        return payManagerService.getReleasePayReconciliationResult(releasePayReconciliationResultDTO);
    }

    /**
     * 网银对账待经办数据查询
     * @param eBankReconciliationPendingDTO
     * @return
     */
    @SysLog("网银对账待经办数据查询")
    @PostMapping(value = "getEBankReconciliationPending")
    @CheckSign
    public Result<Object> getEBankReconciliationPending(@RequestBody @Valid EBankReconciliationPendingDTO eBankReconciliationPendingDTO) {
        return payManagerService.getEBankReconciliationPending(eBankReconciliationPendingDTO);
    }

    /**
     * 网银电子对账经办
     * @param eBankReconciliationHandlingDTO
     * @return
     */
    @SysLog("网银电子对账经办")
    @PostMapping(value = "getEBankReconciliationHandling")
    @CheckSign
    public Result<Object> getEBankReconciliationHandling(@RequestBody @Valid EBankReconciliationHandlingDTO eBankReconciliationHandlingDTO) {
        return payManagerService.getEBankReconciliationHandling(eBankReconciliationHandlingDTO);
    }

    /**
     * 网银电子对帐业务查询
     * @param eBankReconciliationBusinessDTO
     * @return
     */
    @SysLog("网银电子对帐业务查询")
    @PostMapping(value = "getEBankReconciliationBusiness")
    @CheckSign
    public Result<Object> getEBankReconciliationBusiness(@RequestBody @Valid EBankReconciliationBusinessDTO eBankReconciliationBusinessDTO) {
        return payManagerService.getEBankReconciliationBusiness(eBankReconciliationBusinessDTO);
    }

    /**
     * 网银对账明细数据查询
     * @param eBankReconciliationDetailDTO
     * @return
     */
    @SysLog("网银对账明细数据查询")
    @PostMapping(value = "getEBankReconciliationDetail")
    @CheckSign
    public Result<Object> getEBankReconciliationDetail(@RequestBody @Valid EBankReconciliationDetailDTO eBankReconciliationDetailDTO) {
        return payManagerService.getEBankReconciliationDetail(eBankReconciliationDetailDTO);
    }


    /**
     * 企银批量支付批次查询
     * @param paymentBatchDTO
     * @return
     */
    @SysLog("企银批量支付批次查询")
    @PostMapping(value = "getPaymentBatch")
    @CheckSign
    public Result<Object> getPaymentBatch(@RequestBody @Valid PaymentBatchDTO paymentBatchDTO) {
        return payManagerService.getPaymentBatch(paymentBatchDTO);
    }


    /**
     *企银批量支付明细查询
     * @param paymentDetailDTO
     * @return
     */
    @SysLog("企银批量支付明细查询")
    @PostMapping(value = "getPaymentDetail")
    @CheckSign
    public Result<Object> getPaymentDetail(@RequestBody @Valid PaymentDetailDTO paymentDetailDTO) {
        return payManagerService.getPaymentDetail(paymentDetailDTO);
    }


    /**
     * 重复调用
     * @param repeatInvokingDTO
     * @return
     */
    @SysLog("消息重复下发")
    @PostMapping(value = "repeatInvoking")
    @CheckSign
    public Result<Object> repeatInvoking(@RequestBody @Valid RepeatInvokingDTO repeatInvokingDTO) {
        return payManagerService.repeatInvoking(repeatInvokingDTO);
    }

}
